package com.wgy.designmode.structure.filter.criteria;

import com.wgy.designmode.structure.filter.person.Person;

import java.util.List;
import java.util.stream.Collectors;

public class CriteriaSingle implements Criteria{
    @Override
    public List<Person> meetCriteria(List<Person> persons) {

        return persons
                .stream()
                .filter(person -> ("single").equalsIgnoreCase(person.getMaritalStatus()))
                .collect(Collectors.toList());
    }
}
